How to compile just one file in c#

121

How to compile just one file in c# -

For single .cs file compile + run:

In VS 2008, go to "Tools" > "External Tools"
Click on "Add"
Title: Run CSC (or whatever you want)
Command: C:\Windows\system32\cmd.exe
Arguments: /c C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe /target:winexe $(ItemPath) && $(ItemFileName)
Initial directory: $(ItemDir)
Check Use Output Window
Apply + Ok
Go to Tools and choose "Run CSC"
If this doesn't work, verify that your paths for cmd and csc match.

Comments

Submit
0 Comments